Energy management of a resilient and sustainable power infrastructure for a remote area is challenging. For example, environmental and economic considerations make it less feasible today for the construction of long distance transmission lines to remote areas with few as well as sparse population, which will drive up the cost of electricity supply and delivery. Large livestock farms or dairy farms are usually located far away from urban areas and sometimes the electricity supply can be a problem. Additionally, these farms may cause environmental problems brought by the inappropriate treatment of animal waste in these farms. The aggregated piled up animal waste seriously deteriorates the surrounding environment, especially for the air condition. The foul odor sometimes can be smelled miles away along the freeway, where a dairy farm is usually located nearby. Anaerobic digestion is an effective way of dealing with animal waste in these farms, which can protect the environment by consuming animal waste and the produced biogas energy is renewable.
An emerging technical solution to counter the above mentioned problems is the microgrid, which is a regional electric power distribution network consisting of DERs and local loads. Microgrid can:                improve the utility system performance through combined heat and power (CHP), and increasing of the overall transmission utilization,        provide back-up power and premium power,        make use of renewable energy such as biogas, PV and wind, and        reduce greenhouse gas emissions.        
Management and operation of microgrid is complex and many issues should be considered. The basic microgrid architecture may consist of a collection of distributed generation, storage and load assets connected through a system of feeders controlled as a single entity. These entities can be connected to the grid or isolated from the grid based on IEEE 1547 or other applicable standards. Selection and sizing of distributed generation assets (DER) is based on operational characteristics, efficiency, initial cost, and onsite conditions. When a microgrid operates in grid connected mode, the local load receives real/reactive power either from the grid or from local DERs or from both, depending on the customer's situation; when the microgrid switches to stand-alone operation, the power supply, and the load should be the same to clear the power mismatch condition and regulate voltage magnitude and frequency of the islanded system. Microturbines and fuel cells are inertia-less and the response time to control signal is relatively slow; thus, the storage, like batteries or supercapacitors, should be necessarily considered to ensure initial energy balance. Management of grid-tied and islanded system should consider the cost of startup/shutdown and efficiency curves of all generation and storage systems in addition to normal maintenance and fuel costs. Energy arbitrage is another consideration depending on the power purchase agreement between the utility and the microgrid operator.